package cn.kpt.auth.service;

import cn.kpt.beans.pojo.ItripUser;

public interface UserService {

    /**
     * 检查是否有重复手机号
     *
     * @param userCode
     * @return
     * @throws Exception
     */
    ItripUser checkUserIsExists(String userCode) throws Exception;

    /**
     * 注册用户
     *
     * @param itripUser
     * @throws Exception
     */
    void saveInfo(ItripUser itripUser) throws Exception;

    /**
     * 检查验证码
     *
     * @param user
     * @param code
     * @return
     */
    boolean checkActiveCode(String user, String code) throws Exception;

    /**
     * 激活用户
     *
     * @param itripUser
     */
    void activeUser(ItripUser itripUser) throws Exception;

    /**
     * 登录
     *
     * @param name
     * @param password
     * @return
     */
    ItripUser login(String name, String password) throws Exception;

    /**
     * 创建邮箱账号
     *
     * @param name
     * @return
     * @throws Exception
     */
    ItripUser findByUserCode(String name) throws Exception;

    /**
     * 使用邮箱注册用户
     *
     * @param user
     * @throws Exception *
     */
    public void itriptxCreateUser(ItripUser user) throws Exception;
    public void itriptxCreateUsers(ItripUser user) throws Exception;


    /**
     * 邮箱激活
     *
     * @param email 用户注册油箱
     * @param code  激活码
     * @return
     * @throws Exception
     */
    public boolean activate(String email, String code) throws Exception;

    /**
     * 检查第三方用户是否已经注册
     * @param id
     * @return
     * @throws Exception
     */
    ItripUser checkUserByOpenId(String id)throws Exception;

    /**
     * 进行注册
     * @param itripUser
     */
    void registerThirdUser(ItripUser itripUser)throws Exception;
}
